package com.wusuowei.miniouploadfile.controller;

import com.wusuowei.miniouploadfile.service.DownloadService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@Slf4j
@RequestMapping("download")
public class FileDownloadController {

    @Resource
    private DownloadService downloadService;

    @GetMapping(value = "/download")
    public void download(@RequestParam String fileId, HttpServletRequest request, HttpServletResponse response) {
        downloadService.download(fileId, request, response);
    }


}
